Encoding:

EXTEND

11110

offset 10:5

offset 15:11

I8

01100

SWRASP

010

0

000

offset 4:0

5

6

5

5

3

3

5

Format:

SW ra, offset(sp)

MIPS16e

Store Word (SP-Relative, Extended)

Purpose:

Store Word

ra

(SP-Relative, Extended)

To store register ra SP-relative to memory.

Description:

memory[sp + offset] = ra

The 16-bit offsetis sign-extended and then added to the contents of GPR 29 to form the effective address. The contents of GPR 31 are stored at the effective address.

Restrictions:

The effective address must be naturally-aligned. If either of the 2 least-significanbits of the address is non-zero, an

Address Error exception occurs.

Operation:

vAddr = sign_extend(offset) + GPR[29]
if vAddr1..0 != 02 then
   SignalException(AddressError)
endif
(pAddr, CCA) = AddressTranslation (vAddr, DATA, STORE)
dataword = GPR[31]
StoreMemory (CCA, WORD, dataword, pAddr, vAddr, DATA)

Exceptions:

TLB Refill, TLB I valid, TLB Modified, Address Erro